﻿@page "/account/reset-password/"
@layout MainLayout
@attribute [AllowAnonymous]
@inject Microsoft.Extensions.Localization.IStringLocalizer<Reset> _localizer

<EditForm Model="@_resetPasswordModel" OnValidSubmit="SubmitAsync">
    <FluentValidationValidator @ref="_fluentValidationValidator" />
    <MudGrid>
        <MudItem xs="12">
            <div class="d-flex justify-center">
                <MudIcon Icon="@CustomIcons.BlazorHero" Color="Color.Primary" Size="Size.Large" ViewBox="0 0 500 500" Style="width: 100px; height: 100px;" />
            </div>
        </MudItem>
        <MudItem xs="12">
            <div class="d-flex justify-center">
                <MudText Typo="Typo.h4">@_localizer["Reset password"]</MudText>
            </div>
        </MudItem>
        <MudItem xs="12">
            <div class="d-flex justify-center">
                <MudText Typo="Typo.subtitle2" Class="mb-n4">@_localizer["Enter email for password reset"]</MudText>
            </div>
        </MudItem>
        <MudItem xs="12">
            <MudTextField T="string" Label="@_localizer["E-mail"]" @bind-Value="_resetPasswordModel.Email" For="@(() => _resetPasswordModel.Email)" Variant="Variant.Outlined" />
        </MudItem>
        <MudItem xs="12">
            <MudTextField T="string" Label="@_localizer["Password"]" @bind-Value="_resetPasswordModel.Password" For="@(() => _resetPasswordModel.Password)" Variant="Variant.Outlined" InputType="@_passwordInput" Adornment="Adornment.End" AdornmentIcon="@_passwordInputIcon" OnAdornmentClick="TogglePasswordVisibility" />
        </MudItem>
        <MudItem xs="12">
            <MudTextField T="string" Label="@_localizer["Confirm Password"]" @bind-Value="_resetPasswordModel.ConfirmPassword" For="@(() => _resetPasswordModel.ConfirmPassword)" Variant="Variant.Outlined" InputType="InputType.Password" />
        </MudItem>
        <MudItem xs="12" Class="d-flex justify-center">
            <MudButton Variant="Variant.Filled" Disabled="@(!Validated)" Color="Color.Primary" ButtonType="ButtonType.Submit" Size="Size.Large" FullWidth="true">@_localizer["Reset Password"]</MudButton>
        </MudItem>
    </MudGrid>
</EditForm>